<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/master.css" media="screen, projection" />
	
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body class="home index">

<div class="container" id="page">

    <div id='header'>
  <div class='container_16'>
    <div class='grid_16'>
      
      <div id='logo'>
        <a href="/en" title="Home" class="logo"><img alt="CushyCMS Logo" src="/images/logo.png?1314164582" /></a>
      </div>
      
      <div id='language'>
        
        <form action="" method="POST">
          <label>Language:</label>          
          <?php echo CHtml::dropDownList('lang',Yii::app()->language,CHtml::listData(Lang::model()->findAll(),'lang','name'),array('submit' => '')); ?>          
        </form>
        <div class='clear'></div>
        
      </div>
    </div>
    <div class='clear'></div>
    <?php
     
    $this->widget('zii.widgets.CMenu', array(
				'items'=>array(array('label'=>Yii::t('public','Home') , 'url'=>array('/site/index'), 'active'=>Yii::app()->controller->action->id=='index'),
                       array('label'=>Yii::t('public','Demo') , 'url'=>array('/site/demo'), 'active'=>Yii::app()->controller->action->id=='demo'),
                       array('label'=>Yii::t('public','Features & Pricing') , 'url'=>array('/site/pricing'), 'active'=>Yii::app()->controller->action->id=='pricing'),
                       array('label'=>Yii::t('public','Donate') , 'url'=>array('/site/donate'), 'active'=>Yii::app()->controller->action->id=='donate'),
                       array('label'=>Yii::t('public','Sign Up') , 'url'=>array('/site/singup'),'linkOptions'=>array('class'=>'signUp'))        
        ),				
				 'id' => 'nav',
			));
    ?>
       
    
    <?php if(Yii::app()->user->getState("profile")==User::ROLE_ADMIN): ?>
         <ul id='login'>
      <li><a href="#" id="panel_toggle">Panel<span class="toggle">&nbsp;</span></a></li>
    </ul>    
    <?php else : ?>
       <ul id='login'>
      <li><a href="#" id="login_toggle">Log In<span class="toggle">&nbsp;</span></a></li>
    </ul>
    <?php  endif; ?>
    <div class='clear'></div>
    <div class='loginPanel' id="credentials" style="display: none">
      
    <?php echo CHtml::beginForm('','post',array('id'=>'formLogin')); ?>      
      <div>
        <label for="email"><?php echo Yii::t('public','User') ?>:</label><input class="required text" id="email" name="UsersLoginForm[username]" type="text" />
      </div>
        <div>
          <label for="password"><?php echo Yii::t('public','Password') ?>:</label><input class="required text" id="password" name="UsersLoginForm[password]" type="password" />
        </div>
        <div id="resultStudentCourse"></div>
        <?php echo CHtml::ajaxButton(Yii::t('public','Log In'), array('users/login/loginAjax'),array(
        'type'=>'POST',
        'dataType'=>'json',
        
        'beforeSend' => 'function(){
            $("#resultStudentCourse").addClass("loading");
        }',
        'complete' => 'function(){
            $("#resultStudentCourse").removeClass("loading");
            }',
         'success'=>"function(data)
                {
                    errors='';
                    if (data.username != ''  && typeof(data.username) != 'undefined')
                    {
                      errors += '<p>'+data.username+'</p>'  
                    }
                    if (data.password != ''  && typeof(data.password) != 'undefined')
                    {
                      errors += '<p>'+data.password+'</p>' 
                    }
                    if (data.error != '' && typeof(data.error) != 'undefined')
                    {
                      errors += '<p>'+data.error+'</p>' 
                    }
                    if (data.url != '' && typeof(data.url) != 'undefined')
                    {
                      window.location = data.url 
                    }
                    
                    jQuery('#resultStudentCourse').html(errors);
                                                              
                }"
),array('class'=>'loginButton')); ?>
        
        <span class="alternatives">
          <a href="/site/singup"><?php echo Yii::t('public','Sign Up'); ?></a>
          <?php echo CHtml::link('¿Olvidó su Contraseña?',array('users/login/rememberPassword'),array('id'=>'rememberPassword')); ?>
        </span>
    <?php echo CHtml::endForm(); ?>
    </div>

  </div>
</div>



	<div id="mainmenu">
	
	</div><!-- mainmenu -->
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
			'homeLink'=>CHtml::link('Main page', '/admin/site'), 
		)); ?><!-- breadcrumbs -->
	<?php endif?>
  <div id="pageContent" class="min-height">
	<?php echo $content; ?>
   </div>
	 <div id='footer'>
    <div class='container_16'>
      <div class='grid_11'>
        <h6>The Cushy Team</h6>
        <p>Stateless Systems, the team behind Cushy is based in Melbourne, Australia and is passionate about the web. We provide on-demand web services that empower users around the globe by simplifying the way they work.</p>
        <a href="http://www.twitter.com/cushy_cms"><img src="http://twitter-badges.s3.amazonaws.com/follow_us-b.png" alt="Follow Cushy CMS on Twitter" /></a>
        <br />
        <br />
        <a href="http://www.facebook.com/cushycms"><img src="/images/find-us-on-facebook-button.jpg" border="0" /></a>
        <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
        <fb:like href="http://www.facebook.com/cushycms" layout="button_count" show_faces="false" width="350" font=""></fb:like>
      </div>
      <div class='grid_4 push_2'>
        <h6>Network sites:</h6>
        <ul>
          <li><a href="http://retailmenot.com">Coupons</a></li>
          <li><a href="http://trendsmap.com">Trends</a></li>
          <li><a href="http://droolr.com">Gadgets</a></li>
          <li><a href="http://oursignal.com">News</a></li>
        </ul>
      </div>
      <div class='clear'></div>
    </div>
  </div>
  <div class='clear'></div>
  <div id="copyright">
    <div class='container_16'>
      <p>&copy;2010 <a href='http://statelesssystems.com'>Stateless Systems</a> | <a href="/en/static/terms">Terms of Service</a> | <a href="/en/static/privacy">Your Privacy</a> | <a href="/en/static/support">Support</a></p>
    </div>
  </div><!-- footer -->

</div><!-- page -->
<?php
    Yii::app()->clientScript->registerScript('helloscript',"
        jQuery('#login_toggle').click(function() {
          if (jQuery('#credentials').is(':visible')) {
              jQuery('#credentials').hide();
          } else {
              jQuery('#credentials').show();
          }
          
        });
    ",CClientScript::POS_READY);
?>

  
	<?php 
      $this->widget('application.extensions.fancybox.EFancyBox', array(
          'target'=>'#rememberPassword',
          'config'=>array(),
          )
      );
      
  ?>    
	<?php 
     
     $this->widget('application.extensions.fancybox.EFancyBox', array(
          'target'=>'.video',
          'config'=>array('type'=>'swf'),
          )
      );   
    
  ?>
</body>
</html>